# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sysklogd
pkgver=1.5.1
pkgrel=5
pkgdesc="System and kernel log daemons"
url="https://github.com/troglobit/sysklogd"
arch="all"
license="GPL-2.0-or-later"
subpackages="$pkgname-doc $pkgname-openrc"
makedepends="linux-headers"
options="!check"  # requires kernel sources to build oops.ko
source="http://www.infodrom.org/projects/sysklogd/download/sysklogd-$pkgver.tar.gz
	sysklogd.logrotate
	sysklogd.daily
	sysklogd.initd
	sysklogd.confd
	sysklogd-1.4.2-caen-owl-klogd-drop-root.patch
	sysklogd-1.4.2-caen-owl-syslogd-bind.patch
	sysklogd-1.4.2-caen-owl-syslogd-drop-root.patch
	sysklogd-1.5-build.patch
	ksym-fclose-fix.patch
	fix-includes.patch
	syslog.conf
	"

build() {
	make CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
}

package() {
	make INSTALL="install -D" prefix="$pkgdir" install

	install -D -m644 "$srcdir"/sysklogd.logrotate \
		"$pkgdir"/etc/logrotate.d/sysklogd
	install -D -m755 "$srcdir"/sysklogd.daily \
		"$pkgdir"/etc/periodic/daily/sysklogd
	install -D -m755 "$srcdir"/sysklogd.initd "$pkgdir"/etc/init.d/sysklogd
	install -D -m644 "$srcdir"/sysklogd.confd "$pkgdir"/etc/conf.d/sysklogd
	install -D -m644 "$srcdir"/syslog.conf "$pkgdir"/etc/syslog.conf
}

sha512sums="
a72196a1a172d25be1c4791ef6256fe71fa2ba8c1383d230e646e93f8a65c3a57c535189726325da4c792fdb2e9cb119bba43c878816a8e78e78189fd32b12b7  sysklogd-1.5.1.tar.gz
d82caedfa61bfefc0162e5c416ff75a5cd8f60abe1cf8a3c5c4e7775aeb7bb64e712c783031659d3793378c8753578adf73ef79aac6a0e7cfbc5bbba5a74bd81  sysklogd.logrotate
19e7a744f51a3fd4ec26a2c6ddd8c780b8de9cc238dce3b5ecf1c063b81b09b5ae306fccaea958630991c4a1273bb70c532022fc05a752c8a59ac818f81a9c3d  sysklogd.daily
eb4c2c411d75315e113efe40c8445dd2eb7aa88e3318ce3d7624916005ec82325a877c83f5816231fc25d5103ac5be1fc58a4d9593b99fea24c87805abd03039  sysklogd.initd
4553d85e93fb07e7d4a6ed0b47a3ea2044a5605adaac05223724c32a60bb8ae96d99ca95965c3931640beef234e976c1141b83f603aa8c6e8aca1dec20ca807c  sysklogd.confd
1a5cf4a5dec3ecaa8258110820b64d6a8e1e768e841a3f0ade8d7827b91e73c2d8a49a9d8b74566373133627af88dd46d14e83ae1940a0b2e6cd6fe8710a7e7a  sysklogd-1.4.2-caen-owl-klogd-drop-root.patch
995c240fc54681445f68f7681173e1e1860aaab309edc8ac3531881c63c8889f009a7fd622d37145e80fe187410b80c28554140d6a6660134ca87a1c8d13570d  sysklogd-1.4.2-caen-owl-syslogd-bind.patch
87865e069f9c78990660cf29a37ba1ded7cc078ea8f05af63fc6068c470d1881181387477dccb830d96af05f352959181619380d61afccf3a11d213372e68852  sysklogd-1.4.2-caen-owl-syslogd-drop-root.patch
ab979b36f091c62ada916246723cd75a71319a6c3687c034167b9caafc53807e6d224e0d6c836bc4b81b61c1d02ec21a1cb19477396a416c62f097d4b9ccc678  sysklogd-1.5-build.patch
ceb1f7cb70f526dd285fc8bad5511cdef603fc1296f69cc0e7ec4901f11685fae083d028687765b233ca074dfbe0cdafa921de6c80a5cbced94de1059d9761ee  ksym-fclose-fix.patch
0208662a0158ecb6b0a387bd1bf467c866105dac02767209aeaaaeb02762d6c2b814a2707315f8f6cd40f46c4b7744b74653e30973c31354998c27cd7c966dbd  fix-includes.patch
49f73b8a16b92d0cda56db9cfc16d5322e797590dfc998282a62560d54205042af953837f5f94b45a3de403fdf5f63efe65d72e9908c7185a2cd5941275abf33  syslog.conf
"
